package server.io.game.fact.game;

import java.nio.channels.SelectionKey;

import server.io.game.conf.StaticArea;
import server.io.game.fact.Fact_Base;
import server.io.game.fact.Fact_Scene;
import server.io.game.fact.player.Player_Base;
import server.io.game.fact.player.Player_Can;
import server.io.game.fact.room.Room_Base;
import server.io.pro.bean.Pro_JoinRoom;
import server.io.pro.bean.Pro_JoinRoom.Send;
import server.io.pro.ctrl.Pro_Adapter_Base;

public abstract class Game_Base extends Fact_Scene implements Game_Inter
{

	// 每步时间限制
	public int steptime;
	public String game_type;
	// 卡牌种类
	public String[] card_kind;
	public Player_Can players = null;

	public Game_Base()
	{
		// TODO Auto-generated constructor stub
	}

	public Game_Base(int id, String fact_id, String fact_type)
	{
		super(id, fact_id, fact_type);
	}

	@Override
	public void init()
	{
		// TODO Auto-generated method stub

	}

	public void startGame()
	{
		
	}

	/**
	 * 
	 * @param sKey
	 * @param fact_id
	 */
	public void chooseHero(SelectionKey sKey, String fact_id)
	{
//		Player_Base _player = (Player_Base) this.getAttach(sKey, "player");
//		_player.chooseHero(fact_id);
		// 临时
//		this.players.datas[0].hero = StaticArea.can_heros.findData("刘备");
//		this.players.datas[1].hero = StaticArea.can_heros.findData("孙权");
//		this.players.datas[2].hero = StaticArea.can_heros.findData("张飞");
	}

	/**
	 * 分配武将
	 * 
	 * @param sKey
	 * @return
	 */
	public Player_Base allotHero(SelectionKey sKey)
	{
		return null;
//		Player_Base _player = (Player_Base) this.getAttach(sKey, "player");
//		_player.allotHero();
//		return _player;
	}

	/**
	 * 分配手牌
	 * 
	 * @param sKey
	 * @return
	 */
	public Player_Base allotCardHand(SelectionKey sKey)
	{
		return null;
//		Player_Base _player = (Player_Base) this.getAttach(sKey, "player");
//		_player.allotHandCard();
//		return _player;
	}
	
	/**
	 * 网络数据控制中枢
	 * 
	 * @param content
	 * @param key
	 */
	@Override
	public void control(int aStrId, String aStr, SelectionKey key)
	{
		// TODO Auto-generated method stub
		super.control(aStrId, aStr, key);
		byte[] _send = null;
		String _order = "one";
		// 房间的
		switch (aStrId)
		{
		case 1061:
			break;
		default:
			break;
		}

		this.send(_send, _order, key);
	}


}
